home *** CD-ROM | disk | FTP | other *** search
Wrap
Gui4CLI script | 1997-08-20 | 23.3 KB | 992 lines
G4C ; Hi there! ; ; This is a Gui4CLI Script. Once runned, it pops up a GUI (Graphical ; User Interface, in short: a window with buttons) which can be used ; as a frontend for MPEGA. ; ; This script was developed for Gui4CLI version 3 : ; > Author : dck@prometheus.hol.gr (D. Keletsekis) ; > Type : Dev/Gui ; > Version : 3.0 ; > Requires : WB 2.04 or higher ; ; This GUI was developed for MPEGA version 2.9 : ; > MPEGA V2.9 [68020/30] (C)1995-1997 Stéphane TAVENARD ; > Release date: May 29 1997 (68020/30) ; > Email: tavenard@xiii.univ-angers.fr ; ; Gui4CLI can be downloaded from AmiNet from the directory dev/gui. ; MPEGA can be downloaded from AmiNet from the directory mus/play. ; ; If you don't like this script you are allowed to change it yourself. ; If you do so, I would like you to E-mail me your new version. ; If you change this script and redistribute it, you are not allowed ; to erase my copyright notice. Feel free to add your own notice. ; ; This GUI was developed on a screen resolution of 640*495 pixels. ; I've tested it on a PAL 640*256 screen and didn't like the window ; sizes. If you want to run it on a 640*256 screen, you can change ; the default window sizes. How to do that is perfectly described in ; the Gui4CLI documentation (Gui4CLI.guide) which comes with the ; Gui4CLI package. I recommend reading the 'Important Topics! / ; Window Shortcuts' and the 'COMMANDS / WinBig' sections for that. ; ; You also might want to change the default paths the GUI uses. ; They are at lines 61 and 62 of this file. ; ; There are some bugs in this GUI due to the nature of it: it uses ; the OS multitasking. If you want, you can crash it. Just hit some ; different buttons with a very short interval. If you think it's lame ; for that, go buy a faster Miggy... ; ; ; Copyright 1997 M. van Dillen ; E-mail: 1011071@ibk.fnt.hvu.nl WINBIG 1024 11 380 235 'MPEGA GUI v1.0 by Kozmic' WinType 11110001 WinSmall -1 -1 365 190 ICON 180 20 :MPEGA.gc gadid 8 xOnLoad version = 'MPEGA GUI v1.0' Extract MPEGA.gc GuiPath KozPath Exe = 'dh1:music/mpega/mpega' GoSub MPEGA.gc CheckExe defaultpath = 'MP3:' playlistpath = 'MP3:Playlists' header = '@MP3PLAYLIST@' stilte = 0 warning = 1 stilte = 1 playing = 0 files = 0 inf = 0 IF $inf = 1 SetGad MPEGA.gc 8 hide ELSE SetGad MPEGA.gc 10 hide ;box SetGad MPEGA.gc 11 hide ;text SetGad MPEGA.gc 12 hide ;text SetGad MPEGA.gc 13 hide ;text SetGad MPEGA.gc 14 hide ;text SetGad MPEGA.gc 15 hide ;text SetGad MPEGA.gc 16 hide ;text ENDIF JoinFile $KozPath 'MPEGAGUI.options' opfile IfExists FILE $opfile Copy $opfile 'ENV:.MPEGAGUI.options' extra = $.MPEGAGUI.options ENDIF JoinFile $KozPath 'MP3Info' getinfo priority = 0 prio2 = 1 negprio = 0 offset = 0 volume = 128 buffer = 131 maxfreq = 22000 SetVar mf 'Off' SetVar wait 'Off' Update MPEGA.gc 1 0 ; mono Update MPEGA.gc 2 1 ; freq div 2 Update MPEGA.gc 3 1 ; quality good SetGad MPEGA.gc 4 OFF ; AHI Off SetGad MPEGA.gc 6 OFF ; buffer disabled SetGad MPEGA.gc 7 OFF ; max freq disabled redraw MPEGA.gc GuiOpen MPEGA.gc xOnClose GoSub MPEGA.gc cleanup GuiQuit Playlist.gc GuiQuit extra.gc GuiQuit MPEGA.gc ;--- Misc --- xOnKey #13 GoSub MPEGA.gc stop GoSub MPEGA.gc play xOnKey ' ' GoSub MPEGA.gc stop xOnKey 'l' GoSub Playlist.gc load IF $files > 1 ;Playlist window init en openen GuiLoad Playlist.gc GuiOpen Playlist.gc ELSE IFEXISTS Window Playlist.gc GuiClose Playlist.gc ENDIF ENDIF xOnKey #27 GoSub MPEGA.gc cleanup GuiQuit Playlist.gc GuiQuit extra.gc GuiQuit MPEGA.gc xAppWindow Filenames ;alle icons verwerken IF $Filenames > "" ;Listview input maken files = 0 CLI 'Echo "" NOLINE > T:MPEGAGUI.temp' WHILE $Filenames != "" CutVar Filenames CUT WORD 1 eenfile APPEND T:MPEGAGUI.temp $eenfile IF $files = 0 Filename = $eenfile ENDIF CutVar Filenames CUT CHAR 1 space IF $Filenames != "" APPEND T:MPEGAGUI.temp \n ENDIF files == $files + 1 ENDWHILE IF $files > 1 ;Playlist window init en openen GuiLoad Playlist.gc LVUse Playlist.gc 1 LVChange T:MPEGAGUI.temp GuiOpen Playlist.gc ELSE IFEXISTS Window Playlist.gc GuiClose Playlist.gc ENDIF ENDIF Update MPEGA.gc 5 'Current file: $Filename' ENDIF ;play it! GoSub MPEGA.gc stop GoSub MPEGA.gc play ;--- Left gadgets --- XCYCLER 88 10 80 18 "_Mode" "mymode" gadid 1 CStr Mono 0 CStr Stereo 1 XCYCLER 88 30 80 18 "Freq _Div" freq gadid 2 CStr 1 0 CStr 2 1 CStr 4 2 XCYCLER 88 50 80 18 "_Quality" "quality" gadid 3 CStr Worst 0 CStr Good 1 CStr Best 2 XTEXTIN 88 74 80 18 "Buffer time" "buffer" "131" 10 gadid 6 IF $buffer = "" buffer = "0" update MPEGA.gc 9 $buffer ENDIF Update MPEGA.gc 5 'Waiting for buffer to be full will now be enabled' XTEXTIN 88 94 80 18 "Max Freq" "maxfreq" "22049" 10 gadid 7 Update MPEGA.gc 5 'Maximum decoding frequency will be $maxfreq Hz' XTEXTIN 88 114 80 18 "Mode ID" "ahimode" "20004" 5 gadid 4 Update MPEGA.gc 5 'AHI will now be enabled' XTEXTIN 88 134 80 18 "Stream start" "offset" "0" 10 gadid 9 IF $offset = "" offset = "0" update MPEGA.gc 9 $offset ENDIF Update MPEGA.gc 5 'Playing will start at offset $offset seconds' XHSLIDER 88 158 80 18 "_Volume" "volume" 0 256 128 "%ld" IF $volume < 65 Update MPEGA.gc 5 'Volume will be $volume' ELSE Update MPEGA.gc 5 'Volume will be boosted to $volume' ENDIF ;--- Right gadgets --- TEXT 180 10 190 58 "" 1 BOX gadid 10 TEXT 185 12 100 10 "Title:" 6 NOBOX gadid 14 TEXT 185 21 100 10 "<not available>" 30 NOBOX gadid 11 TEXT 185 30 100 10 "Artist / Group:" 15 NOBOX gadid 15 TEXT 185 39 100 10 "<not available>" 30 NOBOX gadid 12 TEXT 185 48 100 10 "Album:" 6 NOBOX gadid 16 TEXT 185 57 100 10 "<not available>" 30 NOBOX gadid 13 XCHECKBOX 200 74 26 18 "_Wait for buffer" "wait" "On" "Off" OFF GadTitle RIGHT IF $wait = "On" setgad MPEGA.gc 6 ON Update MPEGA.gc 5 'Enter seconds of playback buffer' ELSE setgad MPEGA.gc 6 OFF Update MPEGA.gc 5 'Waiting for buffer to be full will now be disabled' ENDIF XCHECKBOX 200 94 26 18 "Ma_x freq" "mf" "On" "Off" OFF GadTitle RIGHT IF $mf = "On" setgad MPEGA.gc 7 ON setgad MPEGA.gc 2 OFF Update MPEGA.gc 5 'Enter maximum playback frequency' ELSE setgad MPEGA.gc 7 OFF setgad MPEGA.gc 2 ON Update MPEGA.gc 5 'Standard playback frequency will be used' ENDIF XCHECKBOX 200 114 26 18 "_AHI" "ahi" "On" "Off" OFF GadTitle RIGHT IF $ahi = "On" setgad MPEGA.gc 4 ON Update MPEGA.gc 5 'Enter the AHI Audio mode ID in hex' ELSE setgad MPEGA.gc 4 OFF Update MPEGA.gc 5 'AHI will now be disabled' ENDIF XCHECKBOX 200 134 26 18 "Audio f_ilter" "filter" "On" "Off" OFF GadTitle RIGHT Update MPEGA.gc 5 'Audio filter will now be $filter' XHSLIDER 266 158 80 18 "P_riority" "priority" -30 30 0 "%ld" IF $priority < 31 Update MPEGA.gc 5 'Process priority of MpegA will be $priority' negprio = 0 ELSE prio2 = 65536 COUNTER prio2 DEC $priority Update MPEGA.gc 5 'Process priority of MpegA will be -$prio2' negprio = 1 ENDIF ;--- Bottom gadgets --- XBUTTON 5 182 120 20 "Choose _file(s)..." Set FilePattern #?MP3#? GoSub MPEGA.gc setwait ReqFile 10 10 300 256 "Choose MPEG Audio file(s)" MULTI "Filenames" $defaultpath GoSub MPEGA.gc setresume IF $Filenames > "" ;Listview input maken files = 0 CLI 'Echo "" NOLINE > T:MPEGAGUI.temp' WHILE $Filenames != "" CutVar Filenames CUT WORD 1 eenfile APPEND T:MPEGAGUI.temp $eenfile IF $files = 0 Filename = $eenfile ENDIF CutVar Filenames CUT CHAR 1 space IF $Filenames != "" APPEND T:MPEGAGUI.temp \n ENDIF files == $files + 1 ENDWHILE IF $files > 1 ;Playlist window init en openen GuiLoad Playlist.gc LVUse Playlist.gc 1 LVChange T:MPEGAGUI.temp GuiOpen Playlist.gc ELSE IFEXISTS Window Playlist.gc GuiClose Playlist.gc ENDIF ENDIF Update MPEGA.gc 5 'Current file: $Filename' ENDIF XBUTTON 130 182 120 20 "_PLAY!" GoSub MPEGA.gc stop GoSub MPEGA.gc play XBUTTON 255 182 120 20 "_Stop playing" GoSub MPEGA.gc stop TEXT 5 210 370 18 "Welcome to Kozmic's MPEGA GUI " 60 BOX gadid 5 ;--- Routines --- XROUTINE play stilte = 0 ;filter bepalen IF $filter = "On" SetVar fil '1' ELSE SetVar fil '0' ENDIF ;freq div bepalen DOCASE $freq CASE = 0 SetVar f '1' BREAK CASE = 1 SetVar f '2' BREAK CASE = 2 SetVar f '4' BREAK ENDCASE ;neg of pos priority bepalen SetVar prioarg '-p' IF $negprio = 1 AppVar prioarg '-$prio2' ELSE AppVar prioarg '$priority' ENDIF ;controleren op een hoge priority warning = 1 IF $priority > 4 AND $negprio = 0 GoSub MPEGA.gc setwait EZReq 'Warning! A high priority may lockup your system!' Continue|Cancel warning GoSub MPEGA.gc setresume ENDIF ;mode bepalen SetVar modearg '-n' ;geen zooi naar stdout IF $mymode = 0 AppVar modearg ' -m' ENDIF ;waardes converteren naar milliseconden SetVar offs '-S' AppVar offs '$offset' AppVar offs '000' SetVar buff '-t' AppVar buff '$buffer' AppVar buff '000' ;volume, wait en maxfreq SetVar volwaitmf '-v$volume' IF $wait = 'On' AppVar volwaitmf ' $buff -w' ENDIF IF $mf = 'On' AppVar volwaitmf ' -F$maxfreq' ENDIF IF $extra > "" AppVar volwaitmf ' $extra' ENDIF ;play it! IF $warning = 1 IF $inf = 1 CLI '$getinfo $Filename >ENV:.MPEGAGUI.inf' ELSE .MPEGAGUI.inf = "" ENDIF LAUNCH 1 '"$Exe" -d$f -q$quality -f$fil $modearg $volwaitmf $prioarg $offs $Filename >NIL:' Update MPEGA.gc 5 'Now playing: $Filename' IF $.MPEGAGUI.inf > "" infostring = $.MPEGAGUI.inf CutVar infostring CUT CHAR 30 eenfile update MPEGA.gc 11 $eenfile CutVar infostring CUT CHAR 30 eenfile update MPEGA.gc 12 $eenfile update MPEGA.gc 13 $infostring ELSE update MPEGA.gc 11 "<not available>" update MPEGA.gc 12 "<not available>" update MPEGA.gc 13 "<not available>" ENDIF playing == $playing + 1 nowplaying = $Filename ELSE Update MPEGA.gc 5 'Canceled' ;cancel in priority warning gekozen ENDIF XOnReturn 1 IF $playing = 1 AND $stilte = 0 IF $files > 1 LVUse Playlist.gc 1 top == $files - 1 IF $$lv.rec = $nowplaying ;geen andere manually chosen IF $$lv.line != $top ;niet? -> next LVGo next ELSE LVGo first ENDIF ENDIF Filename = $$lv.rec ;else choose users wish GoSub MPEGA.gc play ELSE Update MPEGA.gc 5 'Finished' ENDIF ENDIF playing == $playing - 1 xOnFail playing = 0 stilte = 1 Update MPEGA.gc 5 'External error!' XROUTINE stop IF $playing > 0 CLI 'break `status com "$Exe"` >NIL:' Update MPEGA.gc 5 'Playing stopped' stilte = 1 ENDIF XROUTINE setwait GuiWindow MPEGA.gc WAIT GuiWindow Playlist.gc WAIT GuiWindow extra.gc WAIT XROUTINE setresume GuiWindow MPEGA.gc RESUME GuiWindow Playlist.gc RESUME GuiWindow extra.gc RESUME XROUTINE cleanup Delete T:MPEGAGUI.temp Delete ENV:.MPEGAGUI.options Delete ENV:.MPEGAGUI.inf Delete ENV:.MPEGAGUI.header Delete ENV:.MPEGAGUI.filesize IF $playing > 0 EZReq 'MPEGA is still running. What shall I do with it?' "Stop it!|Keep it running" stopit IF $stopit = 1 GoSub MPEGA.gc stop ENDIF ENDIF XROUTINE about EZReq "$version \n\nMPEGAGUI is a frontend for MPEGA,\nan MPEG Audio layer 1, 2 and 3 player.\n\nIt is a Gui4CLI script so you need to get\nthe Gui4CLI package e.g. from AmiNet to get\nit running, but you already knew that unless\nyou're reading this script instead of\nrunning it..\n\nIf you don't like it, change it yourself :-)\n\nCopyright 1997 M. van Dillen (1011071@ibk.fnt.hvu.nl)" Cool! egwel XROUTINE CheckExe IfExists FILE $Exe ; bug Else EZReq "MPEGA Executable not found!\nCurrent definition is:\n'$Exe' \n\nYou have to change the 'Exe' definition in the\nfile 'MPEGA.gc' on line number 59\nwith a texteditor.\n\nFor now, you can locate the executable yourself\n(version 2.9+), edit the file 'MPEGA.gc',\nor exit this marvelous GUI.." "Locate MPEGA|Ed MPEGA.gc|Exit" locate DOCASE $locate CASE = 1 Set FilePattern #?MPEGA#? ReqFile 10 10 300 256 "Locate the MPEGA Executable" LOAD "Exe" $defaultpath BREAK CASE = 2 JoinFile $KozPath 'MPEGA.gc' ThisSux CLI 'C:Ed $ThisSux' EZReq "Please restart MPEGA.gc now." "Exit" egwel GuiQuit Playlist.gc GuiQuit extra.gc GuiQuit MPEGA.gc Stop BREAK CASE = 0 GuiQuit Playlist.gc GuiQuit extra.gc GuiQuit MPEGA.gc Stop BREAK ENDCASE EndIf ;--- Menu's --- xMenu Project "Load Playlist..." "" "L" GoSub Playlist.gc load IF $files > 1 ;Playlist window init en openen GuiLoad Playlist.gc GuiOpen Playlist.gc ELSE IFEXISTS Window Playlist.gc GuiClose Playlist.gc ENDIF ENDIF xMenu Project Play "" "P" GoSub MPEGA.gc stop GoSub MPEGA.gc play xMenu Project Stop "" "S" stilte = 1 GoSub MPEGA.gc stop xMenu Project "" "" "" xMenu Project "About" "#:MPEGA.gc" "" GoSub MPEGA.gc about xMenu Project " " "" "" xMenu Project Quit "" "Q" GuiClose MPEGA.gc xMenu Windows "Extra options..." "" "E" Update extra.gc 1 $extra GuiOpen extra.gc xMenu Windows "Toggle Playlist" "" "" IFEXISTS Window Playlist.gc GuiClose Playlist.gc ELSE GuiOpen Playlist.gc ENDIF xMenu Misc "Toggle MP3 Info" "" "I" IF $inf = 1 inf = 0 SetGad MPEGA.gc 8 show ;logo SetGad MPEGA.gc 10 hide ;box SetGad MPEGA.gc 11 hide ;text SetGad MPEGA.gc 12 hide ;text SetGad MPEGA.gc 13 hide ;text SetGad MPEGA.gc 14 hide ;text SetGad MPEGA.gc 15 hide ;text SetGad MPEGA.gc 16 hide ;text Update MPEGA.gc 5 'No info will be searched' ELSE inf = 1 SetGad MPEGA.gc 8 hide ;logo SetGad MPEGA.gc 10 show ;box SetGad MPEGA.gc 11 show ;text SetGad MPEGA.gc 12 show ;text SetGad MPEGA.gc 13 show ;text SetGad MPEGA.gc 14 show ;text SetGad MPEGA.gc 15 show ;text SetGad MPEGA.gc 16 show ;text Update MPEGA.gc 5 'Songinfo will be searched at playtime' ENDIF redraw MPEGA.gc xMenu Misc "Show status" "" "" IF $playing > 0 CLI 'List lformat %l $nowplaying > ENV:.MPEGAGUI.filesize' thissux = 'Now playing: $nowplaying (' AppVar thissux $.MPEGAGUI.filesize AppVar thissux ')' ; This sucks. You can't say 'blahblah ($variable)' because it then searches ; for the var variable) which doesn't exist. Update MPEGA.gc 5 $thissux Delete ENV:.MPEGAGUI.filesize ELSE Update MPEGA.gc 5 'Idle' ENDIF ;================================================================================================ ;================================================================================================ ;================================================================================================ NEWFILE Playlist.gc WINBIG 1024 267 380 100 'MPEGA GUI Playlist' WinType 11110001 WinSmall -1 -1 158 100 xAppWindow Filenames IF $Filenames > "" ;Listview input maken IfExists FILE T:MPEGAGUI.temp CLI 'Echo "" >> T:MPEGAGUI.temp' ;return plakken ELSE CLI 'Echo "" NOLINE > T:MPEGAGUI.temp' ;file aanmaken files = 0 ENDIF WHILE $Filenames != "" CutVar Filenames CUT WORD 1 eenfile APPEND T:MPEGAGUI.temp $eenfile IF $files = 0 Filename = $eenfile ENDIF CutVar Filenames CUT CHAR 1 space IF $Filenames != "" APPEND T:MPEGAGUI.temp \n ENDIF files == $files + 1 ENDWHILE ;Playlist window init en openen GuiLoad Playlist.gc LVUse Playlist.gc 1 LVChange T:MPEGAGUI.temp GuiOpen Playlist.gc Update MPEGA.gc 5 'Current file: $Filename' ENDIF XListView 0 26 -1 74 "" LVFilename T:MPEGAGUI.temp 0 TXT gadid 1 IF $$lv.rec != 'No Data' Filename = $LVFilename IF $playing > 0 Update MPEGA.gc 5 'Next file: $Filename' ELSE Update MPEGA.gc 5 'Current file: $Filename' ENDIF ENDIF XButton 0 0 76 13 "I" GadFont gc.font 12 000 LVUse Playlist.gc 1 LVGo first Filename = $$lv.rec Update MPEGA.gc 5 'Current file: $Filename' XButton 76 0 76 13 "G" GadFont gc.font 12 000 LVUse Playlist.gc 1 IF $$lv.line != 0 LVGo prev Filename = $$lv.rec Update MPEGA.gc 5 'Current file: $Filename' ENDIF GoSub MPEGA.gc stop GoSub MPEGA.gc play XButton 152 0 76 13 "Sh_uffle" LVUse Playlist.gc 1 tel = $files JoinFile $KozPath 'Random' copyarg Copy $copyarg T: WHILE $tel > 0 CLI 'T:Random $tel > env:.MPEGAGUI.random' LVGo #$.MPEGAGUI.random vorige = $$lv.line LVAdd $$lv.rec LVGo #$vorige LVDel -1 tel == $tel - 1 ENDWHILE Delete T:Random Delete env:.MPEGAGUI.random LVGo first Filename = $$lv.rec Update MPEGA.gc 5 'Current file: $Filename' XButton 228 0 76 13 "g" GadFont gc.font 12 000 LVUse Playlist.gc 1 top == $files - 1 IF $$lv.line != $top LVGo next Filename = $$lv.rec Update MPEGA.gc 5 'Current file: $Filename' ENDIF GoSub MPEGA.gc stop GoSub MPEGA.gc play XButton 304 0 76 13 "i" GadFont gc.font 12 000 LVUse Playlist.gc 1 LVGo last Filename = $$lv.rec Update MPEGA.gc 5 'Current file: $Filename' ;--- 2e regel XButton 0 13 76 13 "_Save" Set FilePattern #? GoSub MPEGA.gc setwait playlistfile = "" ReqFile 10 10 300 256 "Save Playlist to.." SAVE "playlistfile" $playlistpath GoSub MPEGA.gc setresume IF $playlistfile > "" IfExists FILE $playlistfile EZReq "The file '$playlistfile' already exists!" Replace|Cancel replace IF $replace = 1 CLI 'Echo $header > T:MPEGAGUI.header' LVSave T:MPEGAGUI.temp CLI 'Type T:MPEGAGUI.header T:MPEGAGUI.temp > $playlistfile' ENDIF ELSE CLI 'Echo $header > T:MPEGAGUI.header' LVSave T:MPEGAGUI.temp CLI 'Type T:MPEGAGUI.header T:MPEGAGUI.temp > $playlistfile' ENDIF ENDIF XButton 76 13 76 13 "_Load" GoSub Playlist.gc load XButton 152 13 76 13 "_Add" Set FilePattern #?MP3#? GoSub MPEGA.gc setwait ReqFile 10 10 300 256 "Choose MPEG Audio file(s)" MULTI "Filenames" $defaultpath GoSub MPEGA.gc setresume IF $Filenames > "" ;Listview input maken IfExists FILE T:MPEGAGUI.temp CLI 'Echo "" >> T:MPEGAGUI.temp' ;return plakken ELSE CLI 'Echo "" NOLINE > T:MPEGAGUI.temp' ;anders de file aanmaken files = 0 ENDIF WHILE $Filenames != "" CutVar Filenames CUT WORD 1 eenfile APPEND T:MPEGAGUI.temp $eenfile IF $files = 0 Filename = $eenfile ENDIF CutVar Filenames CUT CHAR 1 space IF $Filenames != "" APPEND T:MPEGAGUI.temp \n ENDIF files == $files + 1 ENDWHILE IF $files > 1 ;Playlist window init en openen GuiLoad Playlist.gc LVUse Playlist.gc 1 LVChange T:MPEGAGUI.temp GuiOpen Playlist.gc ELSE IFEXISTS Window Playlist.gc GuiClose Playlist.gc ENDIF ENDIF Update MPEGA.gc 5 'Current file: $Filename' ENDIF XButton 228 13 76 13 "_Del" LVUse Playlist.gc 1 IF $files > 0 LVDel -1 files == $files - 1 top == $files - 1 IF $$lv.line != $top AND $$lv.line != 0 LVGo next ENDIF Filename = $$lv.rec Update MPEGA.gc 5 'Current file: $Filename' LVSave T:MPEGAGUI.temp ELSE Update MPEGA.gc 5 'And.. that was the last one :-)' ENDIF XButton 304 13 76 13 "_Clear" LVUse Playlist.gc 1 LVClear files = 0 IFEXISTS FILE T:MPEGAGUI.temp Delete T:MPEGAGUI.temp ENDIF ;--- Routines --- XROUTINE load Set FilePattern #? GoSub MPEGA.gc setwait ReqFile 10 10 300 256 "Choose a Playlist file" LOAD "playlistfile" $playlistpath GoSub MPEGA.gc setresume IF $playlistfile F= $defaultpath ; bug ELSE IF $playlistfile H= $header Copy $playlistfile T:MPEGAGUI.temp LVUse Playlist.gc 1 LVChange T:MPEGAGUI.temp ;laatste weghalen als ie leeg is (return achter laatste record) LVGo last IF $$lv.rec = "" LVDel -1 ENDIF ;eerste weghalen (header) LVGo first LVDel -1 Filename = $$lv.rec Update MPEGA.gc 5 'Current file: $Filename' files = $$lv.total ;opslaan zonder header en return LVSave T:MPEGAGUI.temp ELSE GoSub MPEGA.gc setwait EZReq "This is not an MPEGAGUI Playlist file!" "You're right. sorry.|Oh yes it is!" joke IF $joke = 0 EZReq "No way! :-)" Oki.. joke ENDIF GoSub MPEGA.gc setresume ENDIF ENDIF ;--- Menu's --- xMenu Project "Load Playlist..." "" "L" GoSub Playlist.gc load IF $files > 1 ;Playlist window init en openen GuiLoad Playlist.gc GuiOpen Playlist.gc ELSE IFEXISTS Window Playlist.gc GuiClose Playlist.gc ENDIF ENDIF xMenu Project Play "" "P" GoSub MPEGA.gc stop GoSub MPEGA.gc play xMenu Project Stop "" "S" stilte = 1 GoSub MPEGA.gc stop xMenu Project "" "" "" xMenu Project "About" "#:MPEGA.gc" "" GoSub MPEGA.gc about xMenu Project " " "" "" xMenu Project Quit "" "Q" GuiClose MPEGA.gc xMenu Windows "Extra options..." "" "E" Update extra.gc 1 $extra GuiOpen extra.gc xMenu Windows "Toggle Playlist" "" "" GuiClose Playlist.gc xMenu Misc "Toggle MP3 Info" "" "I" IF $inf = 1 inf = 0 SetGad MPEGA.gc 8 show ;logo SetGad MPEGA.gc 10 hide ;box SetGad MPEGA.gc 11 hide ;text SetGad MPEGA.gc 12 hide ;text SetGad MPEGA.gc 13 hide ;text SetGad MPEGA.gc 14 hide ;text SetGad MPEGA.gc 15 hide ;text SetGad MPEGA.gc 16 hide ;text Update MPEGA.gc 5 'No info will be searched' ELSE inf = 1 SetGad MPEGA.gc 8 hide ;logo SetGad MPEGA.gc 10 show ;box SetGad MPEGA.gc 11 show ;text SetGad MPEGA.gc 12 show ;text SetGad MPEGA.gc 13 show ;text SetGad MPEGA.gc 14 show ;text SetGad MPEGA.gc 15 show ;text SetGad MPEGA.gc 16 show ;text Update MPEGA.gc 5 'Songinfo will be searched at playtime' ENDIF redraw MPEGA.gc xMenu Misc "Show status" "" "" IF $playing > 0 CLI 'List lformat %l $nowplaying > ENV:.MPEGAGUI.filesize' thissux = 'Now playing: $nowplaying (' AppVar thissux $.MPEGAGUI.filesize AppVar thissux ')' ; This sucks. You can't say 'blahblah ($variable)' because it then searches ; for the var variable) which doesn't exist. Update MPEGA.gc 5 $thissux Delete ENV:.MPEGAGUI.filesize ELSE Update MPEGA.gc 5 'Idle' ENDIF ;================================================================================================ ;================================================================================================ ;================================================================================================ NEWFILE extra.gc WINBIG -1 -1 380 50 'MPEGA Extra commandline options' WinType 11010000 xOnKey #27 extra = $.MPEGAGUI.options Update MPEGA.gc 5 'Extra cmdline options not changed' GuiClose extra.gc XTEXTIN 5 5 370 18 "" "extra" "" 800 gadid 1 xButton 14 28 70 18 "_Save" .MPEGAGUI.options = $extra Copy ENV:.MPEGAGUI.options $opfile Update MPEGA.gc 5 'Extra cmdline options saved: $extra' GuiClose extra.gc xButton 106 28 70 18 "_Use" Update MPEGA.gc 5 'Extra cmdline options set: $extra' GuiClose extra.gc xButton 198 28 70 18 "_Restore" extra = $.MPEGAGUI.options Update extra.gc 1 $extra xButton 291 28 70 18 "_Cancel" extra = $.MPEGAGUI.options Update MPEGA.gc 5 'Extra cmdline options not changed' GuiClose extra.gc xMenu Project Save "" "" .MPEGAGUI.options = $extra Copy ENV:.MPEGAGUI.options $opfile Update MPEGA.gc 5 'Extra cmdline options saved: $extra' GuiClose extra.gc xMenu Project Use "" "" Update MPEGA.gc 5 'Extra cmdline options set: $extra' GuiClose extra.gc xMenu Project Restore "" "" extra = $.MPEGAGUI.options Update extra.gc 1 $extra xMenu Project Cancel "" "" extra = $.MPEGAGUI.options Update MPEGA.gc 5 'Extra cmdline options not changed' GuiClose extra.gc